<template>
  <div id="allmap">
  </div>
</template>

<script>
  import { MP } from '../../assets/js/map'
  export default {
    mounted () {
      this.initMap()
    },
    methods: {
      initMap () {
        MP('5TrqCLkO8SHT0YVm1o8jWAtK4dVEVoeN', function (BMap) {
          var map = new BMap.Map('allmap')
          var point = new BMap.Point(104.038349, 30.645501)
          map.centerAndZoom(point, 18)
          map.addControl(new BMap.MapTypeControl())
          map.enableScrollWheelZoom(true)
          map.enableKeyboard()
          var opts = {
            width: 250,
            height: 60,
            title: '四川智美高科科技有限公司',
            enableMessage: true
          }
          var cotent = '<img src="../../static/images/pos.png" height="12px" width="12px">&nbsp;地址：四川省成都市广福桥横街42号附13号'
          var infoWindow = new BMap.InfoWindow(cotent, opts)
          map.openInfoWindow(infoWindow, point)
        })
      }
    }
  }
</script>
